//
//  HCRemarkInfoViewController.m
//  HelloCall
//
//  Created by WangYongpeng on 13-9-21.
//  Copyright (c) 2013年 HC. All rights reserved.
//

#import "HCRemarkInfoViewController.h"

@implementation HCRemarkInfoViewController

@synthesize remarkInfo = m_remarkInfo;

- (id)init
{
    self = [super init];
    if (nil != self)
    {
        UIBarButtonItem* menuItem = [[[UIBarButtonItem alloc] initWithTitle:@"修改备注" style:UIBarButtonItemStylePlain target:self action:@selector(modifyRemarkPress:)] autorelease];
        self.navigationItem.rightBarButtonItem = menuItem;
        
        self.title = @"查看备注";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc
{
    self.remarkInfo = nil;
    
    [super dealloc];
}

- (void)modifyRemarkPress:(UIBarButtonItem*)button
{
    //修改备注
}

- (void)setRemarkInfo:(HCCallRemarkInfo *)remarkInfo
{
    [remarkInfo retain];
    [m_remarkInfo release];
    m_remarkInfo = remarkInfo;
    
    NSString* text = @"备注信息\n\n";
    
    text = [text stringByAppendingFormat:@"客户ID：%@\n", self.remarkInfo.custID];
    text = [text stringByAppendingFormat:@"备注信息：%@\n", self.remarkInfo.content];
    text = [text stringByAppendingFormat:@"添加者ID：%@\n", self.remarkInfo.addMemoUserID];
    NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy年MM月dd号 HH:mm:ss"];
    text = [text stringByAppendingFormat:@"添加时间：%@\n", [dateFormatter stringFromDate:self.remarkInfo.addMemoDate]];
    text = [text stringByAppendingFormat:@"上次修改时间：%@\n", [dateFormatter stringFromDate:self.remarkInfo.lastModifyDate]];
    text = [text stringByAppendingFormat:@"沟通时间：%@\n", [dateFormatter stringFromDate:self.remarkInfo.contactTime]];
    [dateFormatter release];
    
    [self setDetailText:text];
}


@end
